package com.hison.courseselectionsystem.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @TableName student
 */
@TableName(value = "student")
@Data
@ApiModel(value="Student对象", description="学生信息表")
public class Student implements Serializable {
    /**
     * 学生id，自增
     */
    @ApiModelProperty(value = "主键")
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    /**
     * 学生姓名
     */
    @ApiModelProperty(value = "学生姓名")
    private String name;

    /**
     * 学号
     */
    @ApiModelProperty(value = "学号")
    private String stuId;

    /**
     * 密码
     */
    @ApiModelProperty(value = "密码")
    @JsonIgnore
    private String stuPwd;

    /**
     * 学生性别
     */
    @ApiModelProperty(value = "学生性别")
    private String gender;

    /**
     * 学生年龄
     */
    @ApiModelProperty(value = "学生年龄")
    private Integer age;

    /**
     * 专业
     */
    @ApiModelProperty(value = "专业")
    private String major;

    /**
     * 入学时间
     */
    @ApiModelProperty(value = "入学时间")
    private Date enrollmentTime;

    /**
     * 预计毕业时间
     */
    @ApiModelProperty(value = "预计毕业时间")
    private Date graduationTime;

    /**
     * 电话
     */
    @ApiModelProperty(value = "电话")
    private String phone;

    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱")
    private String email;

    /**
     * 学生的当前状态，如0-在读、1-毕业,2-休学，3-退学等
     */
    @ApiModelProperty(value = "学生的当前状态，如0-在读、1-毕业,2-休学，3-退学等")
    private Integer status;

    /**
     * 家庭地址
     */
    @ApiModelProperty(value = "家庭地址")
    private String addr;

    /**
     * 其他描述
     */
    @ApiModelProperty(value = "其他描述")
    private String description;

    @ApiModelProperty(value = "学生选择的课程")
    @TableField(exist = false)
    private List<Course>  courseList;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Student other = (Student) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
                && (this.getStuId() == null ? other.getStuId() == null : this.getStuId().equals(other.getStuId()))
                && (this.getStuPwd() == null ? other.getStuPwd() == null : this.getStuPwd().equals(other.getStuPwd()))
                && (this.getGender() == null ? other.getGender() == null : this.getGender().equals(other.getGender()))
                && (this.getAge() == null ? other.getAge() == null : this.getAge().equals(other.getAge()))
                && (this.getMajor() == null ? other.getMajor() == null : this.getMajor().equals(other.getMajor()))
                && (this.getEnrollmentTime() == null ? other.getEnrollmentTime() == null : this.getEnrollmentTime().equals(other.getEnrollmentTime()))
                && (this.getGraduationTime() == null ? other.getGraduationTime() == null : this.getGraduationTime().equals(other.getGraduationTime()))
                && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
                && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
                && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
                && (this.getAddr() == null ? other.getAddr() == null : this.getAddr().equals(other.getAddr()))
                && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getStuId() == null) ? 0 : getStuId().hashCode());
        result = prime * result + ((getStuPwd() == null) ? 0 : getStuPwd().hashCode());
        result = prime * result + ((getGender() == null) ? 0 : getGender().hashCode());
        result = prime * result + ((getAge() == null) ? 0 : getAge().hashCode());
        result = prime * result + ((getMajor() == null) ? 0 : getMajor().hashCode());
        result = prime * result + ((getEnrollmentTime() == null) ? 0 : getEnrollmentTime().hashCode());
        result = prime * result + ((getGraduationTime() == null) ? 0 : getGraduationTime().hashCode());
        result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
        result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getAddr() == null) ? 0 : getAddr().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", stuId=").append(stuId);
        sb.append(", stuPwd=").append(stuPwd);
        sb.append(", gender=").append(gender);
        sb.append(", age=").append(age);
        sb.append(", major=").append(major);
        sb.append(", enrollmentTime=").append(enrollmentTime);
        sb.append(", graduationTime=").append(graduationTime);
        sb.append(", phone=").append(phone);
        sb.append(", email=").append(email);
        sb.append(", status=").append(status);
        sb.append(", addr=").append(addr);
        sb.append(", description=").append(description);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}